package org.shibun.spricanvas;

/** A grid representation of a sprite image's data.
 *  
 * Contains a grid (or matrix) representation of a sprite. 
 * @author awniemel
 */
public class SpriteImageGrid {

    static final int DEFAULT_HEIGHT = 32;
    static final int DEFAULT_WIDTH = 32;
    
    private String layerName;
    private int gridWidth;
    private int gridHeight;
    
    public SpriteImageGrid() {
        this(DEFAULT_WIDTH,DEFAULT_HEIGHT);
    }
    public SpriteImageGrid(int squareSideLength) {
        this(squareSideLength, squareSideLength);
    }
    public SpriteImageGrid(int width, int height) {
        this.gridWidth = width;
        this.gridHeight = height;
    }
    public SpriteImageGrid(SpriteImageGrid copyFrom) {
        
    }
    
    
    
    public void growGrid(int widthIncrease, int heightIncrease) {
        
    }
    
    public void growGrid(int widhtIncrease, int heightIncrease, byte anchor) {
        
    }
    
    public void shrinkGrid(int widthDecrease, int heightDecrease) {
        
    }
    public void shrinkGrid(int widhtDecrease, int heightDecrease, byte anchor) {
        
    }
    
    public SpritePixel getPixelAt(int x, int y) {
        if(x < 0 || y < 0 || x >= this.gridWidth || y >= this.gridHeight) {
            throw new IndexOutOfBoundsException("Tried to access pixel outside "+
                    "the bounds of the SpriteImageGrid");
        }
        return null;
    }

    /**
     * @return the layerName
     */
    public String getLayerName() {
        return layerName;
    }

    /**
     * @param layerName the layerName to set
     */
    public void setLayerName(String layerName) {
        this.layerName = layerName;
    }
}
